package fr.jade.fraclite.orb.names;

import fr.jade.fraclite.orb.api.Binder;

public class TcpIpName extends AbstractName {
  
  private static final long serialVersionUID = 1L;
  
  protected String host;
  
  protected int port;
  
  public TcpIpName(long itfId, String signature, Binder naming, String host, int port){
    super(itfId, signature, naming);
    this.host = host;
    this.port = port;
  }

  public String getHost() {
    return host;
  }

  public int getPort() {
    return port;
  }

  public boolean equals(Object o){
    if(o instanceof TcpIpName){
      return super.equals(o) &&
             ((TcpIpName)o).getHost().equals(host) &&
             ((TcpIpName)o).getPort() == port;
    }else{
      return false;
    }
  }
}
